﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Gnosis.Babel;
using Gnosis.SQLite.Clauses;
using Gnosis.SQLite.Predicates;

namespace Gnosis.SQLite
{
    public abstract class Value
        : Expression, IValue
    {
        protected Value(string prefix)
            : base(prefix)
        {
        }

        protected Value(string infix, IExpression left, IExpression right)
            : base(string.Empty, infix, string.Empty, new List<IExpression> { left, right })
        {
        }

        protected Value(string prefix, string infix, string postfix)
            : base(prefix, infix, postfix, new List<IExpression>())
        {
        }

        protected Value(string prefix, string infix, string postfix, IList<IExpression> expressions)
            : base(prefix, infix, postfix, expressions)
        {
        }

        #region IValue Members

        public IPredicate EqualTo(IValue value)
        {
            return new EqualTo(this, value);
        }

        public IPredicate In(IList<IValue> values)
        {
            return new In(values);
        }

        public IPredicate IsNull()
        {
            return new IsNull(this);
        }

        public IPredicate NotEqualTo(IValue value)
        {
            return new NotEqualTo(this, value);
        }

        public IPredicate NotNull()
        {
            return new NotNull(this);
        }

        #endregion
    }
}
